#ifndef BUILDINGMAP_H
#define BUILDINGMAP_H

/* This class represents a zone in the world, e.g. a floor of a building. */
#include "Model.h"
#include "Geometry.h"
#include "Light.h"
#include "WallOpening.h"

#include <boost/serialization/list.hpp>

namespace Model 
{
 
/**
 * A map class for a part of a building.
 * These objects contains the geometry information of the building
 * such as walls, windows and doors, as well as objets such as lights
 * and 3d objets.
 */
class BuildingMap
{
public:
    /**
     * Creates a new empty map.
     */
    BuildingMap();
    
    /**
     * Free all resources.
     */
    ~BuildingMap();
    
    /**
     * Returns the geometry of the map.
     */
    Mesh* walls();
    
    std::list<Light>* lights();
    
    /**
     * Returns the background image file used by the editor.
     */
    std::string background();
    
    /**
     * Sets the background image file.
     */
    void setBackground(std::string filename);
    
private:
    Mesh _walls;
    std::list<WallOpening> _wallOpenings;
    std::list<Light> _lights; 
    std::string _wallTexture, _floorTexture, _ceilTexture;
    std::string _backgroundMap;
    
    friend class boost::serialization::access;
    template<class Archive> 
    void serialize(Archive &ar, const unsigned int version)
    {
        ar & NVP(_walls) & NVP(_wallOpenings) & NVP(_lights)
           & NVP(_wallTexture) & NVP(_floorTexture) & NVP(_ceilTexture)
           & NVP(_backgroundMap);
    }
    
};

}

#endif // BUILDINGMAP_H
